package com.gisuni.sddc.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;

import com.gisuni.sddc.platformManager.dao.LayerTableNameDao;
import com.gisuni.sddc.util.UtilMethod;

@IocBean
public class RegulatePlanDao {
	@Inject
	private Dao dao;  
	@Inject
	private LayerTableNameDao layerTableNameDao;
	
	public List<Map<String, Object>> queryKGContentByInput(String inputText){
		Map<String, String> map  = layerTableNameDao.getTableName();
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
//		String sqlStr="select distinct(KGFLZL) from SDE.KG_1 where KGFLZL like '"+inputText+"%'and rownum <=10 order by KGFLZL asc ";
		String sqlStr="select distinct(KGFLZL) from "+map.get("KG")+" where KGFLZL like '"+inputText+"%'and rownum <=10 order by KGFLZL asc ";
		list = UtilMethod.getFromSql(dao, sqlStr);
		return list;
	}
}
